/**
 * @(#) AcquisitionFactory.java
 *
 * @author lihg
 * @version V1.0 2013-10-1
 *
 * Copyright (C) 2010,2013 , Lihg
 */

/**
 * 
 */
package cn.com.dshome.acquisition.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.com.dshome.acquisition.exception.AcquisitionException;
import cn.com.dshome.acquisition.vo.BaseInformation;
import cn.com.dshome.acquisition.vo.ForeignTradeInformation;
import cn.com.dshome.acquisition.vo.MPInformation;
import cn.com.dshome.acquisition.vo.QiDianNovelInformation;
import cn.com.dshome.acquisition.vo.ZhuBaJieInformation;

/**
 * 
 * Purpose:
 * 
 * @author lihg
 * @see
 * @since
 */
@Service
public class AcquisitionFactory {

	/**
	 * 采集服务接口
	 */

	@Autowired
	@Qualifier("novelAcquisition")
	private Acquisition novelAcquisition ;

	@Autowired
	@Qualifier("bajieAcquisition")
	private Acquisition bajieAcquisiton ;


	@Autowired
	@Qualifier("mpAcquisition")
	private Acquisition mpAcquisition ;

	@Autowired
	@Qualifier("fta")
	private Acquisition fta ;
	/**
	 * 返回采集对象
	 * @param <T>
	 * @param clazz
	 * @return
	 * @throws AcquisitionException
	 */
	public <T extends BaseInformation> Acquisition getAcquisition(Class<T> clazz) throws AcquisitionException{
		//采集猪八戒网信息
		if(clazz == ZhuBaJieInformation.class){
			return bajieAcquisiton ;
		}else if(clazz == QiDianNovelInformation.class){
			return  novelAcquisition ;
		}else if(clazz == MPInformation.class){
			return mpAcquisition ;
		}else if (clazz == ForeignTradeInformation.class){
			return fta ;
		}else{
			return null ;
		}
	}
}


/**
 * Revision history
 * -------------------------------------------------------------------------
 * 
 * Date Author Note
 * -------------------------------------------------------------------------
 * 2013-10-1 下午06:34:02 lihg 创建版本
 */